package edu.ynu.MyProject.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import edu.ynu.MyProject.common.entity.Info;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Set;

@Entity
@Getter
@Setter
@Where(clause = "is_deleted = 0")
public class GreenHouseInfo extends Info {
    @Column
    private String address;

    @Column
    private String area;

    @OneToMany(
            mappedBy = "greenhouse",
            fetch = FetchType.LAZY,
            cascade = CascadeType.ALL
    )
    @JsonIgnoreProperties("greenhouse")
    private Set<Equipment> equipments;
}